include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/External/FBXSDK/builds/include)
include_directories(${PROJECT_SOURCE_DIR}/External/protobuf/lite)
include_directories(${PROJECT_SOURCE_DIR}/External/Lua)
include_directories(${PROJECT_SOURCE_DIR}/External/zip)
GroupDirectories("" "" ${CMAKE_CURRENT_SOURCE_DIR} Groups)

set(RuntimeModules ${Groups})
add_definitions(-DUNICODE -D_UNICODE -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DFT2_BUILD_LIBRARY)
add_library(libRuntime ${RuntimeModules})
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set_target_properties(libRuntime PROPERTIES OUTPUT_NAME "BattleFireEngine")
target_link_libraries(libRuntime libLua libPB)

# 设置目标名称
set(RUNTIME_TARGET Runtime)

# 递归查找所有源文件和头文件
file(GLOB_RECURSE RUNTIME_SOURCES "src/*.cpp")
file(GLOB_RECURSE RUNTIME_HEADERS "include/*.h")

# 添加可执行文件
add_executable(${RUNTIME_TARGET} ${RUNTIME_SOURCES} ${RUNTIME_HEADERS})

# 设置包含目录
target_include_directories(${RUNTIME_TARGET} PRIVATE "include")

# 创建 Visual Studio Filter
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${RUNTIME_SOURCES} ${RUNTIME_HEADERS})